<html xmlns:th="http://www.thymeleaf.org">
<!-- THE HEADER -->
<header class="header" th:fragment="header">
  <div class="container-fluid custom-container">
    <div class="row no_row row-header">

      <div class="header-menu-block">
        <button class="cmn-toggle-switch cmn-toggle-switch__htx"><span></span></button>
        <ul class="header-menu" id="one"></ul>
      </div>
      <div class="login-header-block">
        <div class="login_block">
          <div th:if="${session.member}==null">
            <a class="btn-login btn color-1 size-2 hover-2" href="/frontdesk/blog-detail-2.html"><i class="fa fa-user"></i>登录</a>
          </div>

          <div th:if="${session.member}!=null">
            <div>
              <img class="login-user" th:src="${session.member.profilePicture}" alt="" th:class="touXiang">
              <span >hi, <a th:href="@{/frontdesk/member/personalPage(mid=${session.member.mid})}" th:text="${session.member.username}"></a></span>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
    <script>
        $(function () {

            $.get("/frontdesk/category/all",function (categories) {
                console.log(categories)
                var str="";
                for (var i = 0; i < categories.length; i++) {
                        str+="<li><a href=\"/frontdesk/post/routeList?cid="+categories[i].cid+"\">"+categories[i].cname+"</a></li>";

                }
                $(".header-menu").html(str);
            })

        })
    </script>
</header>

